﻿<ui:DialogWindow x:Class="CrmCodeGenerator.VSPackage.Dialogs.AddTemplate"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:control="clr-namespace:CrmCodeGenerator.Controls;assembly=CrmCodeGenerator.Controls"
        xmlns:vs_shell="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.12.0"
        xmlns:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.12.0"
        Title="Add CRM Code Generator Template to Project" Width="300" SizeToContent="Height" Loaded="Window_Loaded" WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <Style TargetType="Grid" >
            <!--<Setter Property="Background"  Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.DialogBrushKey}}"/>-->
            <!--<Setter Property="Background"  Value="Blue"></Setter>-->
        </Style>
        <Style TargetType="Label">
            <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.DialogTextBrushKey}}"/>
            <Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" />
            <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" />-->
            <Setter Property="Margin" Value="1,5,0,-4" />
        </Style>
        <Style TargetType="TextBox">
            <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowBackgroundBrushKey}}"/>-->
            <!--<Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" />
            <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" />-->
            <Setter Property="Margin" Value="5,0,0,0" />
        </Style>
        <Style TargetType="PasswordBox">
            <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowBackgroundBrushKey}}"/>-->
            <!--<Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" />
            <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" />-->
            <Setter Property="Margin" Value="5,0,0,0" />
        </Style>
        <Style TargetType="ComboBox">
            <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowBackgroundBrushKey}}"/>-->
            <!--<Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" />
            <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" />-->
            <Setter Property="Margin" Value="5,0,0,0" />
        </Style>
        <Style TargetType="TextBlock">
            <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.DialogTextBrushKey}}"/>
            <Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" />
            <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" />-->
        </Style>
        <!--<Style TargetType="Button">
            <Setter Property="FontFamily" Value="{DynamicResource VsFont.EnvironmentFontFamily}" />
            <Setter Property="FontSize" Value="{DynamicResource VsFont.EnvironmentFontSize}" />-->
            <!--<Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowButtonInactiveBrushKey}}" />-->
            <!--<Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.CommandBarBorderBrushKey}}" />
                    <Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.CommandBarMouseOverBackgroundGradientBrushKey}}" />-->
                    <!--<Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.CommandBarTextHoverBrushKey}}"/>-->
                <!--</Trigger>
            </Style.Triggers>
        </Style>-->


    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="Close" Executed="Cancel_Click" />
    </Window.CommandBindings>
    <Window.InputBindings>
        <KeyBinding Key="Escape" Command="Close" />
    </Window.InputBindings>


    <StackPanel Margin="0,0,5,0" >

        <Label Content="Copy template from" IsEnabled="{Binding Path=NewTemplate,Mode=OneWay}" />
        <ComboBox x:Name="DefaultTemplate" ItemsSource="{Binding Path=TemplateList, Mode=TwoWay}" />

        <Label Content="Save Template To"/>
        <Grid Margin="0,0,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="40" />
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" Text="{Binding ElementName=Template, Path=FileName, UpdateSourceTrigger=PropertyChanged}"  Margin="5,0,5,0" />
            <control:FileSelector x:Name="Template"
                                    Grid.Column="1"
                                    FileFilter="Template Files (*.tt)|*.tt"
                                    Mode="Save" 
                                    Folder="{Binding Path=Folder, Mode=OneWay}"
                                    
                                    FileName="{Binding Path=Template, Mode=TwoWay}"/>
        </Grid>
        
        <StackPanel Orientation="Horizontal" Margin="0,0,0,0" HorizontalAlignment="Right">
            <Button Margin="10,10,0,10" MinWidth="70" Click="Add_Click">Add</Button>
            <Button Margin="10,10,0,10" MinWidth="70" Click="Cancel_Click">Cancel</Button>
            
        </StackPanel>


    </StackPanel>

</ui:DialogWindow>
